//
//  ESTAcitvityDetailView.m
//  ESTSCRMAPP
//
//  Created by 李贤立 on 2018/10/16.
//  Copyright © 2018年 Capfer. All rights reserved.
//

#import "ESTAcitvityDetailView.h"
#import "ESTActivityModel.h"
#import "UIButton+WebCache.h"
@interface ESTAcitvityDetailView ()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressText;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UILabel *targetText;
@property (weak, nonatomic) IBOutlet UILabel *targetLabel;
@property (weak, nonatomic) IBOutlet UILabel *speakText;
@property (weak, nonatomic) IBOutlet UIButton *speakButton;
@property (weak, nonatomic) IBOutlet UIView *themeColorView1;
@property (weak, nonatomic) IBOutlet UILabel *themeText;
@property (weak, nonatomic) IBOutlet UILabel *themeLabel;
@property (weak, nonatomic) IBOutlet UIButton *imageView;
@property (weak, nonatomic) IBOutlet UIView *themeColorView2;
@property (weak, nonatomic) IBOutlet UILabel *contentText;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@end

@implementation ESTAcitvityDetailView

+ (instancetype)creatAcitvityDetailView {
    return [[NSBundle mainBundle] loadNibNamed:@"ESTAcitvityDetailView" owner:nil options:nil].lastObject;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.themeColorView1.backgroundColor = ThemeColor;
    self.themeColorView2.backgroundColor = ThemeColor;
}
- (void)setModel:(ESTActivityModel *)model {
    _model = model;
    self.nameLabel.text= model.ACTIVITY_NAME;
    self.dateLabel.text = [NSString stringWithFormat:@"%@ - %@", model.ACTIVITY_STARTDATE, model.ACTIVITY_ENDDATE];
    self.themeLabel.text = model.ACTIVITY_THEME;
    self.addressLabel.text = model.ACTIVITY_PLACE;
    self.targetLabel.text = model.ACTIVITY_TARGET;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:model.ACTIVITY_ATTA_URL1] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:Image_PlaceholderImage_Normal]];
    self.contentLabel.text = model.ACTIVITY_CONTENT;
}
- (IBAction)didClickSpeakButton:(UIButton *)sender {
    if (self.didClickSpeakBlock) {
        self.didClickSpeakBlock();
    }
}
- (IBAction)didCliclImageButton:(UIButton *)sender {
    
}
@end
